package bit.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bit.dao.MemberDAO;

public class MemberDeleteAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {
		
		String num = req.getParameter("num");
		System.out.println(num);
		MemberDAO dao = new MemberDAO();
		int cnt = dao.memDelete(num);
		
		ActionForward forward = null;
		if(cnt>0){
			forward = new ActionForward();
			forward.setPath("./list.do");
			forward.setRedirect(true);
		}	
		return forward;
	}

}
